<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>localForage callWhenReady Tests!</title>

    <link rel="stylesheet" href="/bower_components/mocha/mocha.css">
  </head>
  <body>
    <div id="mocha"></div>

    <script src="/bower_components/assert/assert.js"></script>
    <script src="/bower_components/mocha/mocha.js"></script>

    <script src="/bower_components/expect/index.js"></script>

    <!-- require.js  -->
    <script src="/bower_components/requirejs/require.js"></script>

    <!-- Modernizr  -->
    <script src="/bower_components/modernizr/modernizr.js"></script>

    <!-- Apply "root" level beforeEach hook to run test suite against
         callWhenReady API method stubs -->
    <script src="/test/test.callwhenready.js"></script>

    <script>
        // Skip irrelevant config tests by mapping them to API tests so that
        // they will not be called.
        requirejs.config({
            map: {
                '*': {
                    '/test/test.config.js': '/test/test.api.js'
                }
            }
        });
        var require = this.require;
        if (require) {
            requirejs.config({
                paths: {
                    localforage: '/dist/localforage'
                }
            });
            require(['localforage'], function(localforage) {
                window.localforage = localforage;
                require([
                    '/test/test.api.js',
                    '/test/test.config.js',
                    '/test/test.datatypes.js',
                    '/test/test.drivers.js',
                    '/test/test.iframes.js',
                    '/test/test.webworkers.js'
                ], mocha.run);  // Run tests
            });
        }
        // Disable warning
        window.console.warn = function(){};
    </script>
  </body>
</html>
